home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Gfx / Edit / ImageEngineer / ARexx / VignetteGrey.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  1KB  |  57 lines

  1. /**************************************************/
  2. /* Image Engineer script                          */
  3. /* by Simon Edwards                               */
  4. /* Applies a Grey Vignette effect to an image.    */
  5. /**************************************************/
  6.  
  7. Options results
  8. signal on error            /* Setup a place for errors to go */
  9.  
  10. address 'IMAGEENGINEER'
  11. IE_To_Front
  12. 'REQUEST "This applies a Grey Vigette'||D2C(10)||'effect to an image." "Let''s Go!"'
  13.  
  14. 'GET_FILE "Select an image" "This One"'
  15. filename=result
  16. if filename="" then exit
  17.  
  18. TYPE 24BIT
  19. 'OPEN "'||filename||'"'
  20. source=result
  21.  
  22. CONVERT_TO_GREY source 5 5
  23. greyimage=result
  24. PROJECT_INFO source Width
  25. width=result
  26. PROJECT_INFO source Height
  27. height=result
  28.  
  29. TYPE 8BIT
  30. 'OPEN IE:alpha/Spherical.alpha'
  31. alphachannel=result
  32. SCALE alphachannel width height BEST
  33. newalpha=result
  34. CLOSE alphachannel
  35.  
  36. MARK source PRIMARY
  37. MARK greyimage SECONDARY
  38. MARK newalpha ALPHA
  39. COMPOSITE 0 0 ALPHA
  40.  
  41. CLOSE newalpha
  42. CLOSE greyimage
  43. CLOSE source
  44.  
  45. 'REQUEST "All Done." "Cool."'
  46. exit
  47.  
  48. /*******************************************************************/
  49. /* This is where control goes when an error code is returned by IE */
  50. /* It puts up a message saying what happened and on which line     */
  51. /*******************************************************************/
  52. error:
  53. IE_to_front
  54. LAST_ERROR
  55. 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  56. exit
  57.